<?php

namespace app\admin\controller;

use app\admin\model\KuaiDiOptionsModel;
use app\admin\model\KuaiDiUserModel;
use app\admin\model\QjUserModel;
use app\admin\model\RegionModel;


class Index extends Base {

    public function forgotPassword()
    {
        $user_name = input('user_name', '');
        $password= input('password', '');
        if (empty($user_name) || empty($password)) {
            $res['success'] = false;
            $res['desc'] = '账号或密码不能为空';
            $res['errorcode'] = '200022';
            return json($res);
        }
        $upData = [
            'password' => md5($password),
        ];
        $where[] = [
            'user_name' ,'like', $user_name,
        ];
        $adminModel = new KuaiDiUserModel();
        $res = $adminModel->upUserInfo($upData, $where);
        return json($res);
    }

    public function getOptions()
    {
    
        $model = new KuaiDiOptionsModel();

        $res = $model->getOptionsList();
        return json($res);
        
    }

    public function getStatisticsInfo()
    {

        $model = new KuaiDiOptionsModel();
        $res = $model->getStatisticsInfo();
        return json($res);
    }

}